package day23;

import java.io.File;
import java.util.Scanner;

public class Homework2 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.print("请输入文件夹路径:");
        String s=sc.next();
        File file=new File(s);
        String names[]=file.list((dir, name) -> name.endsWith(".java"));
        for (String name:names){
            System.out.println(name);
        }
    }
}
